package com.yricky.indesk.ui.compose

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.yricky.indesk.ui.compose.shapes.RoundRect

/**
 * @author Yricky
 * @date 2021/12/27
 */
@Preview
@Composable
fun EInkTextButton(
    modifier: Modifier = Modifier ,
    text:String = "Btn",
    onClick:()->Unit = {}
){
    Surface(
        modifier = modifier
            .height(48.dp)
            .background(Color(0xff000000), RoundRect.r(24))
            .padding(1.dp)
            .background(Color(0xffffffff), RoundRect.r(23))
            .clickable { onClick() }
            .padding(24.dp, 0.dp),
        shape = RoundRect.r(24)
    ){
        Box(
            contentAlignment = Alignment.Center
        ){
            Text(
                text = text,
                textAlign = TextAlign.Center,
                fontSize = 20.sp,
                fontWeight = FontWeight.Medium
            )
        }

    }

}